package com.roncoo.eshop.inventory.config;

import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.roncoo.eshop.inventory.listener.InitListener;

import lombok.extern.slf4j.Slf4j;

/**
 * 
* Copyright: Copyright (c) 2019 Hu-Cheng
* 
* @ClassName: ListenerConfig.java
* @Description: 注册监听器
*
* @version: v1.0.0
* @author: hucheng
* @date: 2019年9月19日 上午10:00:06 
*
 */
@Slf4j
@Configuration
public class ListenerConfig {

	@Bean
	@SuppressWarnings({"rawtypes","unchecked"})
	public ServletListenerRegistrationBean servletListenerRegistrationBean() {
		ServletListenerRegistrationBean servletListenerRegistrationBean = 
				new ServletListenerRegistrationBean<>();
		servletListenerRegistrationBean.setListener(new InitListener());
		log.info(">>>>>>>>>>>>>>> init thread and queue");
		return servletListenerRegistrationBean;
	}
	
}
